Home |
| Latest | About | Random
# 21a Basis sets and dimensions of nullspace and columnspace of a matrix. ## Definitions: nullity and rank. Let us now revisit the idea of the nullspace and the columnspace of a given matrix $A$. Recall $\text{nullspace}(A)$ is the set of all vectors $\vec x$ such that $A \vec x = \mathbf{0}$, and by our structural result of homogeneous linear systems from [[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/16-solution-sets-of-a-linear-system-Ax-b|notes 16]], we can express $\text{nullspace}(A)$ as a span of a set of some vectors. This means $\text{nullspace}(A)$ is a **linear space**. Since $\text{nullspace(A)}$ is a linear space, it has a basis set, and therefore its dimension is defined. We say the dimension of the nullspace of a matrix $A$ to be its **nullity**, that is, $$\text{nullity(A)}:=\dim(\text{nullspace(A))}.$$ And recall $\text{columnspace(A)}$ is the span of the columns of $A$. Since it is a span, we have $\text{columnspace}(A)$ is also a **linear space**. And we can speak of a basis and dimension for $\text{columnspace}(A)$. We say the dimension of the columnspace of a matrix $A$ to be its **rank**, that is, $$ \text{rank}(A):=\dim(\text{columnspace}(A)). $$ The astute student would remark here: Didn't we define the rank of a matrix $A$ to be the number of pivots in an echelon form of $A$? Yes we did, and this number is precisely the dimension of the columnspace of $A$! In fact we have > **Proposition.** Rank and nullity of a matrix $A$. > Given a matrix $A$ of size $n\times k$, and suppose an echelon form of $A$ has $r$ many pivots. Then $$ \begin{align*} \text{rank}(A) & = \dim(\text{columnspace}(A)) = r &\text{and} \\ \text{nullity}(A) & = \dim(\text{nullspace}(A)) = k-r \end{align*} $$Note $k-r$ is just the number of free columns in an echelon form of $A$. This implies $$ \text{rank}(A) + \text{nullity(A)} = k = \text{number of columns of \(A\).} $$ **Remark.** Since $\text{rank}(A)$ is the dimension of $\text{columnspace}(A)$, this means there is basis for $\text{columnspace}(A)$ with $\text{rank(A)}$ many vectors. And since $\text{nullity}(A)$ is the dimension of $\text{nullspace(A)}$, this means there is a basis for $\text{nullspace}(A)$ with $\text{nullity}(A)$ many vectors. ## Examples. Consider the matrix $A = \begin{pmatrix}1 & 2 & 3 & 4 \\ 5 & 6 & 7 & 8\end{pmatrix}$. Do the following: (1) Find a basis for $\text{columnspace}(A)$. (2) Find a basis for $\text{nullspace}(A)$. (3) Determine $\text{rank}(A)$ and $\text{nullity}(A)$. (4) What should $\text{rank}(A)+\text{nullity}(A)$ equal to in this case? **Remark.** A strategy to find a basis set is to first find a spanning set first, and then remove redundancies to achieve linear independence. (1) For a basis of $\text{columnspace}(A)$: Let us consider the row reduction $$ \begin{pmatrix}1 & 2 & 3 & 4\\5 & 6 & 7 & 8\end{pmatrix} \stackrel{\text{row}}\sim \begin{pmatrix}1 & 2 & 3 & 4 \\0 & -4 & -8 & -12\end{pmatrix} $$Here we see **two pivots**, so the two columns corresponding to the free columns are redundant. Hence a basis for $\text{columnspace}(A)$ is $$ \{\begin{pmatrix}1\\5\end{pmatrix},\begin{pmatrix}2\\6\end{pmatrix}\}. $$ (2) For a basis of $\text{nullspace}(A)$: Let us consider the row reduction $$ \begin{pmatrix}1 & 2 & 3 & 4 & \vdots & 0\\5 & 6 & 7 & 8 & \vdots & 0\end{pmatrix} \stackrel{\text{row}}\sim \begin{pmatrix}1 & 2 & 3 & 4 & \vdots & 0\\0 & -4 & -8 & -12 & \vdots & 0\end{pmatrix} $$Then we see homogeneous solutions of them form $\begin{pmatrix}x\\y\\z\\w\end{pmatrix}$ has $z,w$ as free variables, where $-4y=8z+12w$, or $y=-2z-3w$; and $z=-2y-3z-4w = -2(-2z-3w)-3z-4w=z+2w$. Writing it parametrically, we see $$ \begin{pmatrix}x\\y\\z\\w\end{pmatrix} = \begin{pmatrix}z+2w\\-2z-3w\\z\\w \end{pmatrix}=z\begin{pmatrix}1\\-2\\1\\0\end{pmatrix} + w\begin{pmatrix}2\\3\\0\\1\end{pmatrix},\quad z,w \text{ free.} $$So $\{\begin{pmatrix}1\\-2\\1\\0\end{pmatrix},\begin{pmatrix}2\\3\\0\\1\end{pmatrix}\}$ is a spanning set for $\text{nullspace}(A)$. If we observe the linear combination of these two vectors, we see that they must be linearly independent because of the third and fourth coordinate. Hence a basis for $\text{nullspace}(A)$ is $$ \{\begin{pmatrix}1\\-2\\1\\0\end{pmatrix},\begin{pmatrix}2\\3\\0\\1\end{pmatrix}\}. $$ (3) From above, we see that $\text{rank}(A) =2$ and $\text{nullity}(A)= 2$. (4) Note, $\text{rank}(A)+\text{nullity}(A)=4$, which is the number of columns of $A$. $\blacklozenge$ **Remark.** If you observe carefully, the process of finding a basis to both $\text{columnspace}(A)$ and $\text{nullspace}(A)$ uses the **same row reduction**. So in fact we can do **both steps at once**! **Example.** Consider the matrix $A = \begin{pmatrix}1 & 2 & 3\\4 & 5 & 6\\7 & 8 & 9\end{pmatrix}$. (1) Find a basis for $\text{columnspace}(A)$. (2) Find a basis for $\text{nullspace}(A)$. (3) Determine $\text{rank}(A)$ and $\text{nullity}(A)$. Let us row reduce $A$ to an echelon form:$$ \begin{pmatrix}1 & 2 & 3\\4 & 5 & 6\\7 & 8 & 9\end{pmatrix} \stackrel{\text{row}}\sim \begin{pmatrix}1 & 2 & 3\\0 & -3 & -6 \\0 & 0 & 0\end{pmatrix} $$ Here we see that the first two columns have pivots, so a basis for $\text{columnspace}(A)$ is $$ \{\begin{pmatrix}1\\4\\7\end{pmatrix},\begin{pmatrix}2\\5\\7\end{pmatrix}\} $$Now imagine the matrix is actually an augmented matrix, with an invisible augmented column of zeros on the right. Then we see the solutions to the homogeneous equation has the form $\begin{pmatrix}x\\y\\z\end{pmatrix}$ with $z$ as free variable, and $-3y=6z$, or $y=-2z$; and $x=-2y-3z = z$. So solutions to the homogeneous equation are $$ \begin{pmatrix}x\\y\\z\end{pmatrix} = \begin{pmatrix}z\\-2z\\z\end{pmatrix}=z\begin{pmatrix}1\\-2\\1\end{pmatrix},\quad \text{\(z\) free.} $$ So a basis to $\text{nullspace}(A)$ is $$ \{\begin{pmatrix}1\\-2\\1\end{pmatrix}\}. $$ By counting the number of basis vectors, we see that $\text{rank}(A)=2$ and $\text{nullity}(A)=1$. $\blacklozenge$